Page({
    data:{
        title:"初学者",
        time:"2016-07-18",
        singer:"薛之谦",
        url:"http://p2.music.126.net/hti_a0LADoFMBHvOBwAtRA==/1369991500930171.jpg?param=177y177",
        list:[
            {
                id:412902689,
                videoSrc:"http://link.hhtjim.com/163/412902689.mp3",
                songname:"初学者",
                name:"薛之谦",
            },
            {
                id:415792881,
                videoSrc:"http://link.hhtjim.com/163/415792881.mp3",
                songname:"刚刚好",
                name:"薛之谦",
            },
            {
                id:417859631,
                videoSrc:"http://link.hhtjim.com/163/417859631.mp3",
                songname:"我好像在哪见过你",
                name:"薛之谦",
            },
            {
                id:421160836,
                videoSrc:"http://link.hhtjim.com/163/421160836.mp3",
                songname:"演员",
                name:"薛之谦",
            },
            {
                id:421148953,
                videoSrc:"http://link.hhtjim.com/163/421148953.mp3",
                songname:"绅士",
                name:"薛之谦",
            },
            {
                id:421160837,
                videoSrc:"http://link.hhtjim.com/163/421160837.mp3",
                songname:"一半",
                name:"薛之谦",
            },
            {
                id:421148954,
                videoSrc:"http://link.hhtjim.com/163/421148954.mp3",
                songname:"小孩",
                name:"薛之谦",
            },
            {
                id:421148955,
                videoSrc:"http://link.hhtjim.com/163/421148955.mp3",
                songname:"Stay Here",
                name:"薛之谦",
            },
            {
                id:421160838,
                videoSrc:"http://link.hhtjim.com/163/421160838.mp3",
                songname:"花儿和少年",
                name:"薛之谦",
            },
            {
                id:421148956,
                videoSrc:"http://link.hhtjim.com/163/421148956.mp3",
                songname:"下雨了",
                name:"薛之谦",
            }
        ]
    },
    tomusic(event) {
        const item = event.currentTarget.dataset.item; // 获取当前点击的数据项
        const { id, videoSrc,songname,name } = item; // 从数据项中解构出
        const { list,url }=this.data
        wx.navigateTo({
            url: `/pages/music/music?id=${id}&videoSrc=${encodeURIComponent(videoSrc)}&songname=${songname}&name=${name}&url=${encodeURIComponent(url)}&list=${encodeURIComponent(JSON.stringify(list))}`,
          });
    }
})